package com.yanyeori.framework.datasource.switcher;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * DB检测状态
 *
 * @author chenkuan 2021/8/20
 */
@Getter
@Setter
@NoArgsConstructor
public class SurviveStatus {
    private boolean survive;
    private long lastSurviveTime;
    private int errorTimes;
    private long elapsedTime;

    public SurviveStatus(boolean survive, long lastSurviveTime, int errorTimes) {
        this.survive = survive;
        this.lastSurviveTime = lastSurviveTime;
        this.errorTimes = errorTimes;
        this.elapsedTime = 3L;
    }
}
